package com.zlx.rulemk.marketing.metrics;

import org.apache.flink.metrics.Gauge;

/**
 * @Author: zhanglingxing
 * @CreateTime: 2022-07-10
 * @Description: TODO
 * @Version: 1.0
 */
public class RuleIsMatchAvgTimeGauge implements Gauge<Float>{

    private long ruleIsMatchCount;
    private long ruleIsMatchTimeAmount;

    @Override
    public Float getValue() {
        return (float)ruleIsMatchTimeAmount/ruleIsMatchCount;
    }

    public void incRuleIsMatchCount(){
        this.ruleIsMatchCount += 1;
    }

    public void incRuleIsMatchTimeAmount(long t){
        this.ruleIsMatchTimeAmount += t;
    }
}
